﻿namespace Vibstudio.NetConfigurator.UI.ViewModels
{
    #region Namespaces

    using System;
    using System.Windows;
    using System.Windows.Input;

    using Vibstudio.NetConfigurator.UI.Common;
    using Vibstudio.NetConfigurator.UI.Util;

    #endregion

    public class ToolbarViewModel : ViewModelBase
    {
        #region Fields

        private RelayCommand _showSettingsCommand;

        #endregion

        #region Public Properties

        public ICommand ShowSettings
        {
            get { return _showSettingsCommand ?? (_showSettingsCommand = new RelayCommand(Show)); }
        }

        #endregion

        #region Methods

        private static void Show(object o)
        {
            try
            {
                StarterProcess.OpenFile((string)o);
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message, e.GetType().Name, MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }

        #endregion
    }
}